/*
 * Allwinner SoCs display driver.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

/*******************************************************************************
 *  All Winner Tech, All Right Reserved. 2014-2015 Copyright (c)
 *
 *  File name   :       de_vep_table.c
 *
 *  Description :       display engine 2.0 video enhancement processor
 *                      common fir table coefficients
 *
 *  History     :       2016/03/29  vito cheng  v0.1  Initial version
 *
 ******************************************************************************/
#include "de_vep_table.h"


s32 fcc_range_gain[6] = {
	0x01550eaa, 0x070503f3, 0x0bdd084f, 0x0a000705,
	0x0eaa0bdd, 0x03330155
};

s32 fcc_hue_gain[6] = {
	0x0, 0x64, 0x3, 0x0, 0x0, 0x0
};

s16 fcc_hue_tab[512] = {
	0x1fe, 0x1fc, 0x1f9, 0x1f4, 0x1ee, 0x1e6, 0x1de, 0x1d4,
	0x1c9, 0x1bd, 0x1b0, 0x1a2, 0x193, 0x183, 0x172, 0x161,
	0x150, 0x13e, 0x12b, 0x119, 0x106, 0x0f3, 0x0e0, 0x0ce,
	0x0bb, 0x0a9, 0x098, 0x087, 0x077, 0x067, 0x059, 0x04b,
	0x03e, 0x032, 0x028, 0x01e, 0x016, 0x00f, 0x009, 0x005,
	0x002, 0x000, 0x000, 0x001, 0x004, 0x008, 0x00d, 0x013,
	0x01b, 0x024, 0x02f, 0x03a, 0x046, 0x054, 0x062, 0x072,
	0x082, 0x092, 0x0a4, 0x0b5, 0x0c8, 0x0da, 0x0ed, 0x0ff,
	0x112, 0x125, 0x137, 0x14a, 0x15b, 0x16d, 0x17d, 0x18d,
	0x19d, 0x1ab, 0x1b9, 0x1c5, 0x1d0, 0x1db, 0x1e4, 0x1ec,
	0x1f2, 0x1f7, 0x1fb, 0x1fe, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff, 0x1ff,
	0x1ff, 0x1ff, 0x1ff, 0x1fe, 0x1fb, 0x1f7, 0x1f2, 0x1ec,
	0x1e4, 0x1db, 0x1d0, 0x1c5, 0x1b9, 0x1ab, 0x19d, 0x18d,
	0x17d, 0x16d, 0x15b, 0x14a, 0x137, 0x125, 0x112, 0x100,
	0x0ed, 0x0da, 0x0c8, 0x0b5, 0x0a4, 0x092, 0x082, 0x072,
	0x062, 0x054, 0x046, 0x03a, 0x02f, 0x024, 0x01b, 0x013,
	0x00d, 0x008, 0x004, 0x001, 0x000, 0x000, 0x000, 0x001,
	0x002, 0x003, 0x004, 0x006, 0x008, 0x00a, 0x00c, 0x00f,
	0x012, 0x015, 0x018, 0x01b, 0x01e, 0x022, 0x025, 0x029,
	0x02d, 0x031, 0x034, 0x038, 0x03c, 0x040, 0x043, 0x047,
	0x04a, 0x04d, 0x051, 0x054, 0x056, 0x059, 0x05b, 0x05e,
	0x060, 0x061, 0x063, 0x064, 0x065, 0x066, 0x066, 0x066,
	0x066, 0x066, 0x065, 0x064, 0x063, 0x061, 0x060, 0x05e,
	0x05b, 0x059, 0x056, 0x054, 0x051, 0x04d, 0x04a, 0x047,
	0x043, 0x040, 0x03c, 0x038, 0x034, 0x031, 0x02d, 0x029,
	0x025, 0x022, 0x01e, 0x01b, 0x018, 0x015, 0x012, 0x00f,
	0x00c, 0x00a, 0x008, 0x006, 0x004, 0x003, 0x002, 0x001,
	0x000, 0x000, 0x000, 0x000, 0x002, 0x003, 0x005, 0x008,
	0x00b, 0x00f, 0x013, 0x017, 0x01c, 0x022, 0x027, 0x02d,
	0x034, 0x03b, 0x041, 0x049, 0x050, 0x057, 0x05f, 0x066,
	0x06e, 0x075, 0x07d, 0x084, 0x08b, 0x092, 0x099, 0x09f,
	0x0a5, 0x0ab, 0x0b0, 0x0b5, 0x0ba, 0x0be, 0x0c1, 0x0c5,
	0x0c7, 0x0c9, 0x0cb, 0x0cc, 0x0cc, 0x0cc, 0x0cc, 0x0cb,
	0x0ca, 0x0c8, 0x0c6, 0x0c3, 0x0c1, 0x0bd, 0x0ba, 0x0b6,
	0x0b2, 0x0ad, 0x0a9, 0x0a4, 0x09f, 0x09a, 0x094, 0x08f,
	0x089, 0x084, 0x07e, 0x078, 0x073, 0x06d, 0x068, 0x062,
	0x05d, 0x058, 0x054, 0x04f, 0x04b, 0x047, 0x043, 0x040,
	0x03d, 0x03a, 0x038, 0x036, 0x035, 0x034, 0x033, 0x033,
	0x033, 0x034, 0x035, 0x036, 0x038, 0x03a, 0x03d, 0x040,
	0x043, 0x047, 0x04b, 0x04f, 0x054, 0x058, 0x05d, 0x062,
	0x068, 0x06d, 0x073, 0x078, 0x07e, 0x084, 0x089, 0x08f,
	0x094, 0x09a, 0x09f, 0x0a4, 0x0a9, 0x0ad, 0x0b2, 0x0b6,
	0x0ba, 0x0bd, 0x0c1, 0x0c3, 0x0c6, 0x0c8, 0x0ca, 0x0cb,
	0x0cc, 0x0cc, 0x0cc, 0x0cc, 0x0cb, 0x0c9, 0x0c7, 0x0c5,
	0x0c1, 0x0be, 0x0ba, 0x0b5, 0x0b0, 0x0ab, 0x0a5, 0x09f,
	0x099, 0x092, 0x08b, 0x084, 0x07d, 0x075, 0x06e, 0x066,
	0x05f, 0x057, 0x050, 0x049, 0x041, 0x03b, 0x034, 0x02d,
	0x027, 0x022, 0x01c, 0x017, 0x013, 0x00f, 0x00b, 0x008,
	0x005, 0x003, 0x002, 0x000, 0x000, 0x000, 0x002, 0x005,
	0x009, 0x00f, 0x016, 0x01e, 0x028, 0x032, 0x03e, 0x04b,
	0x059, 0x067, 0x077, 0x087, 0x098, 0x0a9, 0x0bb, 0x0ce,
	0x0e0, 0x0f3, 0x106, 0x119, 0x12b, 0x13e, 0x150, 0x161,
	0x172, 0x183, 0x193, 0x1a2, 0x1b0, 0x1bd, 0x1c9, 0x1d4,
	0x1de, 0x1e6, 0x1ee, 0x1f4, 0x1f9, 0x1fc, 0x1fe, 0x1ff

};

u16 ce_bypass_lut[256] = {
	0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40,
	44, 48, 52, 56, 60, 64, 68, 72, 76, 80,
	84, 88, 92, 96, 100, 104, 108, 112, 116, 120,
	124, 128, 132, 136, 140, 144, 148, 152, 156, 160,
	164, 168, 172, 176, 180, 184, 188, 192, 196, 200,
	204, 208, 212, 216, 220, 224, 228, 232, 236, 240,
	244, 248, 252, 256, 260, 264, 268, 272, 276, 280,
	284, 288, 292, 296, 300, 304, 308, 312, 316, 320,
	324, 328, 332, 336, 340, 344, 348, 352, 356, 360,
	364, 368, 372, 376, 380, 384, 388, 392, 396, 400,
	404, 408, 412, 416, 420, 424, 428, 432, 436, 440,
	444, 448, 452, 456, 460, 464, 468, 472, 476, 480,
	484, 488, 492, 496, 500, 504, 508, 512, 516, 520,
	524, 528, 532, 536, 540, 544, 548, 552, 556, 560,
	564, 568, 572, 576, 580, 584, 588, 592, 596, 600,
	604, 608, 612, 616, 620, 624, 628, 632, 636, 640,
	644, 648, 652, 656, 660, 664, 668, 672, 676, 680,
	684, 688, 692, 696, 700, 704, 708, 712, 716, 720,
	724, 728, 732, 736, 740, 744, 748, 752, 756, 760,
	764, 768, 772, 776, 780, 784, 788, 792, 796, 800,
	804, 808, 812, 816, 820, 824, 828, 832, 836, 840,
	844, 848, 852, 856, 860, 864, 868, 872, 876, 880,
	884, 888, 892, 896, 900, 904, 908, 912, 916, 920,
	924, 928, 932, 936, 940, 944, 948, 952, 956, 960,
	964, 968, 972, 976, 980, 984, 988, 992, 996, 1000,
	1004, 1008, 1012, 1016, 1020
};
u16 ce_constant_lut[256] = {
	0, 3, 6, 8, 11, 14, 17, 20, 23, 26, 29,
	32, 35, 38, 42, 45, 48, 51, 54, 58, 61,
	64, 68, 71, 74, 78, 81, 85, 88, 92, 95,
	99, 102, 106, 110, 113, 117, 120, 124, 128, 132,
	135, 139, 143, 147, 151, 154, 158, 162, 166, 170,
	174, 178, 182, 186, 190, 194, 198, 202, 206, 210,
	214, 218, 222, 227, 231, 235, 239, 243, 247, 252,
	256, 260, 264, 269, 273, 277, 282, 286, 290, 295,
	299, 303, 308, 312, 316, 321, 325, 330, 334, 339,
	343, 348, 352, 356, 361, 365, 370, 374, 379, 383,
	388, 393, 397, 402, 406, 411, 415, 420, 424, 429,
	434, 438, 443, 447, 452, 457, 461, 466, 470, 475,
	480, 484, 489, 494, 498, 503, 507, 512, 517, 521,
	526, 531, 535, 540, 544, 549, 554, 558, 563, 567,
	572, 577, 581, 586, 591, 595, 600, 604, 609, 613,
	618, 623, 627, 632, 636, 641, 645, 650, 654, 659,
	663, 668, 672, 677, 681, 686, 690, 695, 699, 704,
	708, 713, 717, 721, 726, 730, 735, 739, 743, 748,
	752, 756, 760, 765, 769, 773, 777, 782, 786, 790,
	794, 798, 803, 807, 811, 815, 819, 823, 827, 831,
	835, 839, 843, 847, 851, 855, 859, 863, 867, 871,
	874, 878, 882, 886, 890, 893, 897, 901, 904, 908,
	912, 915, 919, 922, 926, 929, 933, 936, 940, 943,
	947, 950, 953, 957, 960, 963, 966, 970, 973, 976,
	979, 982, 985, 988, 991, 994, 997, 1000, 1003, 1006,
	1009, 1012, 1015, 1017, 1020
};
